<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
  <script>
      var book = {}
      var name = '';
      Object.defineProperty(book,'name',{
          set(value){
              name = value
              console.log('你取了一个书名叫做' + value)
          },
          get(){
              return `《${name}》`
          }
      })

      book.name = '毛泽东语录'
      console.log(book.name)
      console.log(book);

      
  </script>
</body>
</html>